freeswitch-stable: add mod_gsmopen 232/head
authorSebastian Kemper <[email protected]>
Tue, 2 Jan 2018 10:21:57 +0000 (11:21 +0100)
committerSebastian Kemper <[email protected]>
Tue, 2 Jan 2018 10:21:59 +0000 (11:21 +0100)
Add mod_gsmopen to be able to use FreeSWITCH as a GSM gateway (for SMS
and voice calls).

Signed-off-by: Sebastian Kemper <[email protected]>
net/freeswitch-stable/Makefile
net/freeswitch-stable/patches/270-fix-uclibc-iconv-in-gsmopen.patch [new file with mode: 0644]

index b3308d3474273cfc1e43bef2092e14d195260ee7..45bf0cb3de7278bb95b61cb95ee9189c85e9d589 100644 (file)
@@ -154,6 +154,7 @@ FS_STABLE_MOD_AVAILABLE:= \
        g723_1 \
        g729 \
        graylog2 \
+       gsmopen \
        h26x \
        hash \
        hiredis \
@@ -915,6 +916,13 @@ ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-pocketsphinx),)
 endif
 endif
 
+# Hack for mod_gsmopen - it has a build-time dep on mod_spandsp
+ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-gsmopen),)
+ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-spandsp),)
+       $(SED) '/mod_spandsp$$$$/s/^#//' $(PKG_BUILD_DIR)/modules.conf
+endif
+endif
+
 # Hack for mod_unimrcp - it has a build-time dep on mod_sofia
 ifneq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-unimrcp),)
 ifeq ($(CONFIG_PACKAGE_$(PKG_NAME)-mod-sofia),)
@@ -1070,6 +1078,7 @@ $(eval $(call Package/$(PKG_NAME)/Module,fsv,FSV,This module provides dialplan a
 $(eval $(call Package/$(PKG_NAME)/Module,g723_1,G.723.1 passthrough,G.723.1 codec passthrough.,))
 $(eval $(call Package/$(PKG_NAME)/Module,g729,G.729 passthrough,G.729 codec passthrough.,))
 $(eval $(call Package/$(PKG_NAME)/Module,graylog2,Graylog2 logger,GELF logger for Graylog2 and Logstash.,))
+$(eval $(call Package/$(PKG_NAME)/Module,gsmopen,GSM endpoint,GSMopen is a channel driver that allows an SMS to be sent to and from\nFreeSWITCH as well as incoming and outgoing GSM voice calls.,+gsmlib +libctb +libjpeg +liblzma))
 $(eval $(call Package/$(PKG_NAME)/Module,h26x,H.26x passthrough,H.26x video codec passthrough.,))
 $(eval $(call Package/$(PKG_NAME)/Module,hash,Hash,This module provides a key-value in-memory datastore. Usable as a\nlimit backend.,))
 $(eval $(call Package/$(PKG_NAME)/Module,hiredis,Redis client,This module provides a mechanism to use Redis as a datastore.,+libhiredis))
diff --git a/net/freeswitch-stable/patches/270-fix-uclibc-iconv-in-gsmopen.patch b/net/freeswitch-stable/patches/270-fix-uclibc-iconv-in-gsmopen.patch
new file mode 100644 (file)
index 0000000..7170f7b
--- /dev/null
@@ -0,0 +1,62 @@
+--- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
++++ b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
+@@ -2521,11 +2521,11 @@ int ucs2_to_utf8(private_t *tech_pvt, ch
+       DEBUGA_GSMOPEN("1 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
+                                  GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out);
+-#ifdef WIN32
++#ifdef __UCLIBC__ // libiconv-full needs this conversion
+       iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#else // WIN32
++#else
+       iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#endif // WIN32
++#endif
+       if (iconv_res == (size_t) -1) {
+               DEBUGA_GSMOPEN("2 ciao in=%s, inleft=%d, out=%s, outleft=%d, converted=%s, utf8_out=%s\n",
+                                          GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, converted, utf8_out);
+@@ -2560,11 +2560,11 @@ int utf8_to_iso_8859_1(private_t *tech_p
+       DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, iso_8859_1_out=%s\n",
+                                  GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, iso_8859_1_out);
+-#ifdef WIN32
++#ifdef __UCLIBC__
+       iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#else // WIN32
++#else
+       iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#endif // WIN32
++#endif
+       if (iconv_res == (size_t) -1) {
+               DEBUGA_GSMOPEN("cannot translate in iso_8859_1 error: %s (errno: %d)\n", GSMOPEN_P_LOG, strerror(errno), errno);
+               return -1;
+@@ -2597,11 +2597,11 @@ int iso_8859_1_to_utf8(private_t *tech_p
+       }
+       inbytesleft = strlen(iso_8859_1_in) * 2;
+-#ifdef WIN32
++#ifdef __UCLIBC__
+       iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#else // WIN32
++#else
+       iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#endif // WIN32
++#endif
+       if (iconv_res == (size_t) -1) {
+               DEBUGA_GSMOPEN("ciao in=%s, inleft=%d, out=%s, outleft=%d, utf8_out=%s\n",
+                                          GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_out);
+@@ -2642,11 +2642,11 @@ int utf8_to_ucs2(private_t *tech_pvt, ch
+       DEBUGA_GSMOPEN("in=%s, inleft=%d, out=%s, outleft=%d, utf8_in=%s, converted=%s\n",
+                                  GSMOPEN_P_LOG, inbuf, (int) inbytesleft, outbuf, (int) outbytesleft, utf8_in, converted);
+-#ifdef WIN32
++#ifdef __UCLIBC__
+       iconv_res = iconv(iconv_format, (const char **) &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#else // WIN32
++#else
+       iconv_res = iconv(iconv_format, &inbuf, &inbytesleft, &outbuf, &outbytesleft);
+-#endif // WIN32
++#endif
+       if (iconv_res == (size_t) -1) {
+               ERRORA("error: %s %d\n", GSMOPEN_P_LOG, strerror(errno), errno);
+               return -1;